<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8" />
    <title>13_DOM2-高级浏览器-绑定方法1-解绑</title>
</head>

<body>
    <button id="bind">绑定</button>
    <button id="unBind">解绑</button>

    <script>
        var bind = document.querySelector('#bind');

        bind.addEventListener('click', function () {
            console.log(1111);
        })

        var unBind = document.querySelector('#unBind');
        unBind.addEventListener('click', function () {
            // 解绑
            bind.removeEventListener('click', function () {
                console.log(1111);
            })
        })
    </script>
</body>

</html>